<?php

require_once(DIR_LIB."VsCore".DIR_SEP."vsauth.php");

require_once(DIR_LIB."VsGui".DIR_SEP."vsmenu.php");

class VsAdminToolbar extends VsMenu {

	private $_auth = NULL;

	function __construct() {
		parent::__construct();

		$this->_wwwDir = 'templates/XCart/';
		$this->assign('wwwDir', $this->_wwwDir);
		$this->_template = dirname(__FILE__).DIR_SEP."vsadmin_toolbar.html";

		$this->_auth = VsAuth::Instance();

		$this->init();
	}
	//==========================================================================

	function show() {
		$this->assign('menuTitle', 'VsAdminToolbar');
		//$this->assign('tbItems', $this->_menuItems);
		
		return parent::show();
	}
	//==========================================================================

	private function init() {
		$this->addItem(new VsMenuItem('Get Page for Design Edit', $_SERVER['PHP_SELF']."?tb_act=save_page"));

		if($this->_auth->level()==9) {
			$this->addItem(new VsMenuItem('Remove Backup Files', $_SERVER['PHP_SELF']));
			$this->addItem(new VsMenuItem('Backup Database Structure', $_SERVER['PHP_SELF']));
			$this->addItem(new VsMenuItem('Backup Database Data', $_SERVER['PHP_SELF']));

		}
	}
	//==========================================================================

};

?>
